package modulesAPI.v2.basics;

import com.caterina.components.CLabel;
import com.caterina.components.CPanel;

import modulesAPI.v2.Module;
import modulesAPI.v2.ViewType;

public class EmptyModule extends Module<String>{
	/**
	 * Pannello vuoto
	 * */
	public EmptyModule(String text){
		super(null,text, text, text,ViewType.READ_ONLY);
	}
	public EmptyModule() {
		this("NO_CONTENT");
	}
	@Override
	protected CPanel getReadOnlyPanel(boolean isSelected) {
		CPanel retPanel=new CPanel();
		retPanel.setOpaque(false);
		retPanel.add(new CLabel(this.getTag()));
		return retPanel;
	}
	public String getContent(){
		return null;
	}
	@Override
	protected CPanel getWritablePanel(boolean isSelected) {
		return this.getReadOnlyPanel(isSelected);
	}
	@Override
	public CPanel getInListPanel(boolean isSelected) {
		return this.getReadOnlyPanel(isSelected);
	}
	@Override
	protected CPanel getOneLinePanel(boolean isSelected) {
		return this.getReadOnlyPanel(isSelected);
	}
	@Override
	protected void beforeFireChange(Module<?> mod) {}
	@Override
	protected void afterFireChange(Module<?> mod) {}
}
